home *** CD-ROM | disk | FTP | other *** search
/ Best of Shareware / Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso / mac / ZIPPED / DOS / GRAPHICS / POVSRC.ZIP / MACHINE.ZIP / MAC.SIT / stdio_p2w.h < prev    next >
Text File  |  1992-04-24  |  3KB  |  89 lines

  1. /*
  2. ==============================================================================
  3. Copyright 1992, esp, All Rights Reserved
  4. ------------------------------------------------------------------------------
  5. Project:    POV
  6.  
  7. File Name:    stdio_p2w.h
  8.  
  9. Description:
  10.     General-purpose printf-capturing routines that allow a console-like
  11.     output window for c programs that otherwise prefer to use printf/fprintf.
  12.     This code was "inspired heavily" from sources such as MacDTS'es TESample,
  13.     MacApp's Transcript window, and previous code of mine.  It is fairly well
  14.     self-contained, and works in MPW C 3.2 and Think C 5.0.
  15.  
  16.     This file contains global definitions used by any source files that would
  17.     otherwise include <stdio.h>.. that is, non-Macintosh-toolbox-aware.  It is
  18.     _REQUIRED_ that those files be modified to include "stdio_p2w.h" instead of
  19.     <stdio.h>, since this header will include <stdio.h> for them.
  20.     NOTE: If stdio.h is included after this header, problems will occur.
  21.  
  22. Related Files:
  23.     stdio_p2w.h        - generic header for sources that would otherwise use <stdio.h>
  24.     printf2window.h    - Mac-specific header for p2w routines
  25.     printf2window.c    - the main source for the p2w routines
  26. ------------------------------------------------------------------------------
  27. Author:
  28.     Eduard [esp] Schwan
  29. ------------------------------------------------------------------------------
  30. Copyright 1992 POV-Team.
  31.     This source code is distributed exclusively with POV, and is subject to
  32.     the same distribution restrictions as the rest of the source code.
  33.  
  34. *  Copying, distribution and legal info is in the file povlegal.doc which
  35. *  should be distributed with this file. If povlegal.doc is not available
  36. *  or for more information please contact:
  37. *
  38. *       Drew Wells [POV-Team Leader] 
  39. *       CIS: 73767,1244  Internet: 73767.1244@compuserve.com
  40. *       Phone: (213) 254-4041
  41. ------------------------------------------------------------------------------
  42. Change History:
  43.     920326    [esp]    Created.
  44.     920330    [esp]    Updated file header with copyright & related files info
  45.     920424  (jln)   removed putc definition to avoid problems writing Targa format.
  46. ==============================================================================
  47. */
  48.  
  49. #ifndef __stdio_p2w__
  50. #define __stdio_p2w__
  51.  
  52. #include <stdio.h>
  53.  
  54.  
  55. // ==== <stdio.h> replacement macros (Forces std C i/o to call us instead)
  56.  
  57. #undef    fflush
  58. #undef    fprintf
  59. #undef    fputc
  60. #undef    fputs
  61. #undef    printf
  62. #undef    putc
  63. #undef    putchar
  64. #undef    puts
  65.  
  66. #define fflush        p2w_fflush
  67. #define fprintf        p2w_fprintf
  68. #define fputc        p2w_fputc
  69. #define fputs        p2w_fputs
  70. #define printf        p2w_printf
  71. //define putc        p2w_putc  -yeah right! not until we get pass-thru to system for non-console.
  72. #define putchar        p2w_putchar
  73. #define puts        p2w_puts
  74.  
  75. // ==== Std C library replacement routines
  76.  
  77. int p2w_fflush(FILE *stream);
  78. int p2w_fprintf(FILE *stream, const char *format, ...);
  79. int p2w_fputc(int theChar, FILE *stream);
  80. int p2w_fputs(const char *theString, FILE *stream);
  81. int p2w_printf(const char * format, ...);
  82. int p2w_putc(int theChar, FILE *stream);
  83. int p2w_putchar(const char theChar);
  84. int p2w_puts(const char *theString);
  85.  
  86.  
  87. #endif __stdio_p2w__
  88.